package com.sptus.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sptus.common.annotation.DataSource;
import com.sptus.common.core.domain.AjaxResult;
import com.sptus.common.enums.DataSourceType;
import com.sptus.framework.service.BaseCommonService;
import com.sptus.service.ISptUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.sptus.mapper.slave.SptUserMapper;
import com.sptus.entity.SptUser;

/**
 * @Description: spt_user
 * @Author: jeecg-boot
 * @Date:   2024-09-24
 * @Version: V1.0
 */
@DataSource(DataSourceType.SLAVE)
@Service
//@DS("multi-datasource1")
public class SptUserServiceImpl extends ServiceImpl<SptUserMapper, SptUser> implements ISptUserService {



    @Resource
    private BaseCommonService baseCommonService;
    @Override
    public AjaxResult checkUserIsEffective(SptUser one) {
        return AjaxResult.success();
    }

    @Override
    public List<SptUser> selectList(LambdaQueryWrapper<SptUser> sptUserLambdaQueryWrapper) {
        return this.getBaseMapper().selectList(sptUserLambdaQueryWrapper);
    }

    @Override
    public IPage<HashMap<String, Object>> getUserListPage(Page<SptUser> page, QueryWrapper<SptUser> lambdaQueryWrapper) {

        return this.getBaseMapper().getUserListPage(page,lambdaQueryWrapper);
    }

    @Override
    public void removeUserById(String id) {
         this.getBaseMapper().removeUserById(id);
    }

    @Override
    public ArrayList<HashMap<String, Object>> getUserClass() {
        return this.getBaseMapper().getUserClass();
    }
}
